﻿@using SCMS.Resource
@model SCMS.UI.Models.UUnitOfMeasure
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "ContentDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action("CreateEdit"),
      OnSuccess = "CloseDialog();if (document.getElementById('table') != null) {initSorter();sorter.size(20);}"
  };
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
       
    @using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
    {
        @Html.ValidationSummary(true)
        <table>
            <tr>
                <td align="right">@Resources.UnitOfMeasure_CreateEdit_Code<font color="red">*</font>:</td>
                <td>
                    @Html.EditorFor(model => model.Code)<br />
                    @Html.ValidationMessageFor(model => model.Code)
                    @Html.HiddenFor(model => model.Id)
                </td>
            </tr>
            <tr>
                <td align="right">@Resources.Global_String_Description:</td>
                <td>
                    @Html.TextAreaFor(model => model.Description)<br />
                    @Html.ValidationMessageFor(model => model.Description)
                </td>
            </tr>
            <tr>
                <td align="right">&nbsp;</td>
                <td>
                    <input type="submit" class="btn green" value="@(ViewBag.Action != null ? ViewBag.Action : Resources.Global_String_Save)" />
                    @if (ViewBag.Action != null)
                    {
                        @Html.Hidden("Action", "Edit")
                    }
                    else
                    {
                        @Html.Hidden("Action", "")
                    }
                </td>
            </tr>
        </table>
    }